package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.Dish;
import com.sky.entity.DishFlavor;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @version 1.0
 * @description 说明
 * @package com.sky.mapper
 */
@Mapper
public interface DishFlavorMapper {

    /**
     * 添加菜品口味
     * @param flavor
     */
    void insert(DishFlavor flavor);

    /**
     * 批量添加菜品的口味
     * @param list
     */
    void insertBatch(List<DishFlavor> list);

    /**
     * 通过菜品id删除对应的口味信息
     * @param dishId
     */
    @Delete("delete from dish_flavor where dish_id=#{dishId}")
    void deleteByDishId(Long dishId);

    /**
     * 通过菜品的id查询口味信息
     * @param dishId
     * @return
     */
    @Select("select * from dish_flavor where dish_id=#{dishId}")
    List<DishFlavor> selectByDishId(Long dishId);
}
